All Questions
Tagged with text-formattingshell-script
59 questions
3votes
2answers
97views
fixing or finding an alternative to bad 'paste <(jcal) <(ccal)' output
(I don't have a high enough reputation to comment my question into: how to show stdout outputs of two programs side by side ) I've tried paste <(jcal) <(ccal) but the output is messed up. jcal; ...
1vote
1answer
288views
Script to select a PulseAudio sink from an ordered list and use its name as command input
I wish to write a bash script that will create a PulseAudio loopback device between an audio source and a bluetooth device. (Context - skippable) So far I have (the relevant part of) my script as: ...
3votes
2answers
204views
Indent Fortran source code, propagate indentation down to unindented special lines
I'm trying to write my own script to improve some auto-formatting before commiting to a remote repository. I use indenting guides in my IDE and the autoformatters available for my language (FORTRAN) ...
0votes
3answers
100views
Pull certain lines of text out of a large group of files
I am trying to yank all of the individual Unix commands out of a large group of text files. Here is what I have so far: In this example I am pulling out all instances of the tx command. The big group ...
0votes
1answer
517views
Xsetroot output truncation?
I've been working on a config for dwm 6.3 with a bunch of patches (on GuixSD, if it matters). Most of them haven't been updated to work on 6.3, so it's been a lot of effort to get everything sorted ...
1vote
1answer
1kviews
Appending spaces to the rest of fixed length record in UNIX Script
I have the data for about 40 characters in the record of 250 length(FIXED). But I want to append the remaining 250-40=210 characters with SPACES. How do we do in UNIX Script?
-3votes
2answers
162views
awk or sed to format variable durations
Tried a lot of awk and sed commands, but cant get the file to format properly. The primary issue is with handling of extra comma in the middle of a column that exits sometimes and doesnt exist other ...
0votes
1answer
2kviews
how to replace spaces in a string with '\ ' in bash
I'm writing a bash script that prints the contents of a file called website (using cat) that is inside a folder with a space in it's name, for example folder 1. but I can't make bash get the path ...
0votes
1answer
554views
how to get the name of each folder inside a certain folder
I'm writing a bash script that needs to list all the names of folders inside a certain folder and print their description from a file inside each folder. here is a example filesystem: main || \/ ...
0votes
1answer
197views
Bash - Convert problematic space-separated table to semicolon-delimeted list
I have a program that outputs many lines of data in a space-separated table. I need to convert this output to a semicolon-separated list. This is an example record. Each field has a set number of ...
3votes
1answer
10kviews
Escaping backlash and double quotes inside a sed expression (surrounded by double quotes)
$ echo 'output: " ' | sed "s/\"/\"/" output: " $ echo 'output: " ' | sed "s/\"/\\\"/" output: " $ echo 'output: " ' | sed "s/\&...
-1votes
1answer
2kviews
grep and re-direct to csv
This is the campaign log that I am parsing. Based on call-id I do grep. Orginal Progress-log as follows: FilePlayer::run:: Finished audio file is /voip/VoiceCampaigSetup/wildfly-10.1.0.Final/...
0votes
4answers
268views
Need a script or command to append the previous line with the current line that starts with a lower case letter
The output I'm trying to format before opening the file in excel looks like this: 1. |1.99934| BD | 1| C 1 - H 2 | 60.12%| 0.7754* C 1 s| 24.99%|p 3.00| 74.95%|d 0.00| 0.05%| f 0.00| 0.01%| |...
1vote
1answer
780views
How to log CPU usage but only when it is high or touching certain treshold ? (+ formatting)
How can we log CPU usage but only when there is a process(s) with utilization above certain threshold (for example 30% or more) ? What i am trying to achieve (with shell script) are more or less like ...
0votes
4answers
100views
Renaming in sed to allow further match before substituting
I was trying to rename texts in fileA using sed. The second last column in fileA is where the full description of product names lies. I would like to substitute the product names with its ID. However, ...